Ext.ns("HT");
Ext.ns("HT.ux.plugins");
function $getGdSelectedIds(grid, idName) {
	var selRs = grid.getSelectionModel().getSelections();
	var ids = Array();
	for ( var i = 0; i < selRs.length; i++) {
		ids.push(eval("selRs[i].data." + idName));
	}
	return ids;
}
function $postDel(a) {
	Ext.Msg.confirm("信息确认", "您确认要删除所选记录吗？", function(b) {
		if (b == "yes") {
			Ext.Ajax.request({
				url : a.url,
				params : {
					ids : a.ids
				},
				method : "POST",
				success : function(c, d) {
					Ext.ux.Toast.msg("操作信息", "成功删除该记录！");
					if (a.callback) {
						a.callback.call(this);
						return;
					}
					if (a.grid) {
						a.grid.getStore().reload();
					}
				},
				failure : function(c, d) {
					Ext.ux.Toast.msg("操作信息", "操作出错，请联系管理员！");
				}
			});
		}
	});
}
function $postForm(a) {
	if (a.formPanel.getForm().isValid()) {
		var b = a.scope ? a.scope : this;
		a.formPanel.getForm().submit({
			scope : b,
			url : a.url,
			method : "post",
			params : a.params,
			waitMsg : "正在提交数据...",
			success : function(c, d) {
				Ext.ux.Toast.msg("操作信息", "成功保存信息！");
				if (a.callback) {
					a.callback.call(b, c, d);
				}
			},
			failure : function(c, d) {
				Ext.MessageBox.show({
					title : "操作信息",
					msg : d.result.message==null?"信息保存出错，请联系管理员！":d.result.message,
					buttons : Ext.MessageBox.OK,
					icon : "ext-mb-error"
				});
				if (a.callback) {
					a.callback.call(b);
				}
			}
		});
	}
}
function $delGridRs(a) {
	var b = $getGdSelectedIds(a.grid, a.idName);
	if (b.length == 0) {
		Ext.ux.Toast.msg("操作信息", "请选择要删除的记录！");
		return;
	}
	var c = {
		url : a.url,
		ids : b,
		grid : a.grid
	};
	$postDel(c);
}
function $search(d) {
	var a = d.searchPanel;
	var e = d.gridPanel;
	if (a.getForm().isValid()) {
		var b = e.getStore();
		var f = Ext.Ajax.serializeForm(a.getForm().getEl());
		var c = Ext.urlDecode(f);
		c.start = 0;
		c.limit = b.baseParams.limit;
		b.baseParams = c;
		e.getBottomToolbar().moveFirst();
	}
}
HT.SearchPanel = Ext.extend(Ext.form.FormPanel, {
	constructor : function(f) {
		var e = f.colNums ? f.colNums : 1;
		Ext.apply(this, f);
		if (e > 1 && f.items) {
			this.items = [];
			var j = null;
			var g = 0;
			for ( var d = 0; d < f.items.length; d++) {
				var h = f.items[d];
				if (h.xtype != "hidden") {
					if (g % e == 0) {
						j = {
							xtype : "compositefield",
							fieldLabel : h.fieldLabel,
							items : [],
							defaults : {
								style : "margin:0 0 0 0"
							}
						};
						this.items.push(j);
					} else {
						var a = ":";
						if (this.superclass.labelSeparator) {
							a = this.superclass.labelSeparator;
						}
						var c = 100;
						if (this.labelWidth) {
							c = this.labelWidth;
						}
						if (h.labelWidth) {
							c = h.labelWidth;
						}
						var b = "text-align:left";
						if ("right" == this.labelAlign) {
							b = "text-align:right";
						}
						if (h.fieldLabel) {
							j.items.push({
								xtype : "label",
								width : c,
								style : b,
								text : h.fieldLabel + a
							});
						}
					}
					j.items.push(h);
					g++;
				} else {
					this.items.push(h);
				}
			}
		}
		HT.SearchPanel.superclass.constructor.call(this, {
			autoHeight : true,
			border : false,
			style : "padding:6px;background-color: white",
			buttonAlign : "center"
		});
	}
});
DicCombo = Ext.extend(Ext.form.ComboBox, {
	constructor : function(a) {
		Ext.apply(this, a);
		var c = this.itemName;
		var b = this.isDisplayItemName;
		DicCombo.superclass.constructor.call(this, {
			triggerAction : "all",
			store : new Ext.data.ArrayStore({
				autoLoad : true,
				baseParams : {
					itemName : c
				},
				url : __ctxPath + "/system/loadItemDictionary.do",
				fields : [ "itemId", "itemName" ]
			}),
			displayField : "itemName",
			valueField : b ? "itemName" : "itemId"
		});
	}
});
Ext.reg("diccombo", DicCombo);
HT.ux.plugins.Export = Ext
		.extend(
				Object,
				{
					constructor : function(a) {
						Ext.apply(this, a);
						HT.ux.plugins.Export.superclass.constructor.call(this,
								a);
					},
					init : function(b) {
						var a = new Ext.SplitButton(
								{
									text : "导出",
									iconCls : "btn-export",
									menu : new Ext.menu.Menu(
											{
												items : [
														{
															text : "导出当前页EXCEL",
															iconCls : "btn-export-excel",
															listeners : {
																click : function() {
																	var c = b
																			.findParentBy(function(
																					d,
																					e) {
																				return (d instanceof Ext.grid.GridPanel) ? true
																						: false;
																			});
																	CommonExport(
																			c,
																			false,
																			"xls");
																}
															}
														},
														{
															text : "导出全部记录EXCEL",
															iconCls : "btn-export-excel",
															listeners : {
																click : function() {
																	var c = b
																			.findParentBy(function(
																					d,
																					e) {
																				return (d instanceof Ext.grid.GridPanel) ? true
																						: false;
																			});
																	CommonExport(
																			c,
																			true,
																			"xls");
																}
															}
														},
														"-",
														{
															text : "导出当前页PDF",
															iconCls : "btn-export-pdf",
															listeners : {
																click : function() {
																	var c = b
																			.findParentBy(function(
																					d,
																					e) {
																				return (d instanceof Ext.grid.GridPanel) ? true
																						: false;
																			});
																	CommonExport(
																			c,
																			false,
																			"pdf");
																}
															}
														},
														{
															text : "导出全部记录PDF",
															iconCls : "btn-export-pdf",
															listeners : {
																click : function() {
																	var c = b
																			.findParentBy(function(
																					d,
																					e) {
																				return (d instanceof Ext.grid.GridPanel) ? true
																						: false;
																			});
																	CommonExport(
																			c,
																			true,
																			"pdf");
																}
															}
														} ]
											})
								});
						b.add("->");
						b.add("-");
						b.add(a);
						b.add("-");
						b.on({
							beforedestroy : function() {
								a.destroy();
							}
						});
					}
				});
function CommonExport(c, h, j) {
	var m = c.getColumnModel().columns;
	var n = "";
	var b = "";
	for ( var i = 0; i < m.length; i++) {
		if (i > 2 && m[i].isExp == true) {
			n += m[i].header + ",";
			if (m[i].javaRenderer != null) {
				b += "javaRenderer" + m[i].javaRenderer + ",";
			} else {
				b += m[i].dataIndex + ",";
			}
		}
	}
	if (n.length > 0) {
		n = n.substring(0, n.length - 1);
		b = b.substring(0, b.length - 1);
	}
	var k = {
		isExport : true,
		isExportAll : h,
		exportType : j,
		colId : b,
		colName : n
	};
	Ext.apply(k, c.store.baseParams);
	var g = document.getElementById("downloadFrame");
	if (!g) {
		g = document.createElement("iframe");
		g.setAttribute("id", "downloadFrame");
		document.body.appendChild(g);
	}
	var e;
	if (g.contentDocument) {
		e = g.contentDocument;
	} else {
		if (g.contentWindow) {
			e = g.contentWindow.document;
		} else {
			e = g.document;
		}
	}
	if (e.document) {
		e = e.document;
	}
	var f = e.body;
	if (!f) {
		e
				.write("<head><meta http-equiv='Content-Type' content='text/html; charset=UTF-8'></head>");
		f = e.createElement("body");
		e.appendChild(f);
	}
	var d = e.getElementById("downloadForm");
	if (d) {
		e.body.removeChild(d);
	}
	d = e.createElement("form");
	d.id = "downloadForm";
	e.body.appendChild(d);
	var a = c.store.proxy.url;
	for ( var o in k) {
		var l = e.createElement("input");
		l.type = "hidden";
		l.name = o;
		l.value = k[o];
		d.appendChild(l);
	}
	d.method = "post";
	d.action = a;
	d.submit();
}
HT.ux.plugins.Print = Ext.extend(Object, {
	constructor : function(a) {
		Ext.apply(this, a);
		HT.ux.plugins.Export.superclass.constructor.call(this, a);
	},
	init : function(b) {
		var a = new Ext.Button({
			text : "打印",
			iconCls : "btn-print",
			listeners : {
				click : function() {
					var c = b
							.findParentBy(function(d, e) {
								return (d instanceof Ext.grid.GridPanel) ? true
										: false;
							});
					gpObj = document.getElementById(c.id);
					window.open(__ctxPath + "/js/printer/Print.jsp");
				}
			}
		});
		b.add("->");
		b.add("-");
		b.add(a);
		b.on({
			beforedestroy : function() {
				a.destroy();
			}
		});
	}
});
HT.PagingBar = Ext
		.extend(
				Ext.PagingToolbar,
				{
					constructor : function(b) {
						var a = {
							pageSize : b.store.baseParams.limit ? b.store.baseParams.limit
									: 25,
							displayInfo : true,
							displayMsg : "当前显示从{0}至{1}， 共{2}条记录",
							emptyMsg : "当前没有记录",
							plugins : [ new Ext.ux.plugins.PageComboResizer() ]
						};
						if (b.exportable) {
							a.plugins.push(new HT.ux.plugins.Export({
								store : b.store
							}));
						}
						if (b.printable) {
							a.plugins.push(new HT.ux.plugins.Print());
						}
						Ext.apply(a, b);
						HT.PagingBar.superclass.constructor.call(this, a);
					}
				});
HT.JsonStore = Ext.extend(Ext.data.JsonStore, {
	constructor : function(a) {
		var c = a.baseParams ? a.baseParams : {};
		c.start = 0;
		c.limit = 25;
		var b = {
			baseParams : c,
			root : "result",
			totalProperty : "totalCounts",
			remoteSort : true
		};
		Ext.applyIf(b, a);
		HT.JsonStore.superclass.constructor.call(this, b);
	}
});
HT.initGridConfig = function(a) {
	if (!a.store) {
		a.store = new HT.JsonStore({
			url : a.url,
			fields : a.fields,
			baseParams : a.baseParams
		});
		if (a.url) {
			a.store.load();
		}
	}
	a.sm = new Ext.grid.CheckboxSelectionModel({
		singleSelect : a.singleSelect ? a.singleSelect : false
	});
	if (a.columns) {
		a.columns.unshift(a.sm);
		a.columns.unshift(new Ext.grid.RowNumberer());
	} else {
		a.columns = [ a.sm, new Ext.grid.RowNumberer() ];
	}
	if (!a.tbar && a.isShowTbar != false) {
		a.tbar = new Ext.Toolbar();
	}
	if (a.addTool) {
		a.tbar.add(new Ext.Button({
			text : "添加记录",
			iconCls : "btn-add",
			scope : this,
			handler : function() {
				var d = a.store.recordType;
				a.store.add(new d());
			}
		}));
	}
	this.cm = new Ext.grid.ColumnModel({
		columns : this.columns,
		defaults : {
			sortable : true,
			menuDisabled : false,
			width : 100
		}
	});
	a.plugins = [];
	if (a.rowActions) {
		var c = a.columns[a.columns.length - 1];
		a.plugins.push(c);
	}
	if (a.printable) {
		a.plugins.push(HT.ux.plugins.Print);
	}
	var b = {
		shim : true,
		trackMouseOver : true,
		disableSelection : false,
		loadMask : true,
		stripeRows : true,
		viewConfig : {
			forceFit : true,
			enableRowBody : false,
			showPreview : false
		},
		bbar : (a.showPaging == null || a.showPaging) ? new HT.PagingBar({
			store : a.store,
			ownExp : a.ownExp
		}) : null
	};
	Ext.apply(b, a);
	return b;
};
HT.GridPanel = Ext.extend(Ext.grid.GridPanel, {
	constructor : function(a) {
		var b = HT.initGridConfig(a);
		HT.GridPanel.superclass.constructor.call(this, b);
	}
});
HT.EditorGridPanel = Ext.extend(Ext.grid.EditorGridPanel, {
	constructor : function(a) {
		var b = HT.initGridConfig(a);
		HT.GridPanel.superclass.constructor.call(this, b);
	}
});
Ext.reg("htgrid", HT.GridPanel);
Ext.reg("hteditorgrid", HT.EditorGridPanel);
HT.FormPanel = Ext.extend(Ext.form.FormPanel, {
	constructor : function(a) {
		var b = {
			layout : "form",
			bodyStyle : "padding:5px",
			defaults : {
				anchor : "96%,96%"
			},
			defaultType : "textfield",
			border : false
		};
		Ext.apply(b, a);
		HT.FormPanel.superclass.constructor.call(this, b);
	}
});
Ext
		.override(
				Ext.Panel,
				{
					loadData : function(conf) {
						if (!conf.root) {
							conf.root = "data";
						}
						var ct = this;
						//【begin】modify by wanghuawen for panel加载数据时combo还没有load，导致combo显示value而不显示name的问题 on 20160330
						var getValueByName = function(name, data, conf) {
							if (name) {
								if (conf.preName) {
									if (name.indexOf(conf.preName) != -1) {
										name = name.substring(conf.preName.length + 1);
									}
								}
								var val = eval("data." + name);
								if (!Ext.isEmpty(val)) {
									return val;
								}
							}
							return "";
						};
						var setByName = function(container, data,conf) {
							var items = container.items;
							if (items != null && items != undefined
									&& items.getCount) {
								for ( var i = 0; i < items.getCount(); i++) {
									var comp = items.get(i);
									if (comp.items) {
										setByName(comp, data,conf);
										continue;
									}
									var xtype = comp.getXType();
									try {
											if (xtype == "textfield" || xtype == "textarea" || xtype == "radio"
												|| xtype == "checkbox" || xtype == "datefield" || xtype == "hidden"
												|| xtype == "numberfield" || xtype == "datetimefield"
												|| xtype == "timefield" || xtype == "htmleditor"
												|| xtype == "ckeditor" || xtype == "displayfield"
												|| xtype == "diccombo") {
											var compValue = getValueByName(comp.getName(), data,conf);
											if (compValue == "") {
												compValue = comp.getValue();
											}
											if(xtype=='datefield'||xtype=='datetimefield'){
												comp.setValue(new Date(compValue));
											}else{
												comp.setValue(compValue);
											}
										} else {
											if (xtype == "combo" || xtype == "iconcomb") {
												comp.valueNotFoundText = getValueByName(comp.name,data,conf);
												comp.setValue(getValueByName(comp.getName(), data,conf));
											} else {
												if (xtype == "combotree") {
													comp.setValue(getValueByName(comp.name, data,conf));
													comp.hiddenField.value = getValueByName(comp.hiddenName,
															data,conf);
												}
											}
										}
									//【end】modify by wanghuawen for panel加载数据时combo还没有load，导致combo显示value而不显示name的问题 on 20160330
									} catch (e) {
										console.error(e);
									}
								}
							}
						};
						
						if (!ct.loadMask) {
							ct.loadMask = new Ext.LoadMask(Ext.getBody());
							ct.loadMask.show();
						}
						var scope = conf.scope ? conf.scope : ct;
						var params = conf.params ? conf.params : {};
						Ext.Ajax
								.request({
									method : "POST",
									url : conf.url,
									scope : scope,
									params : params,
									success : function(response, options) {
										var json = Ext.util.JSON
												.decode(response.responseText);
										var data = null;
										if (conf.root) {
											data = eval("json." + conf.root);
										} else {
											data = json;
										}
										setByName(ct, data,conf);
										if (ct.loadMask) {
											ct.loadMask.hide();
											ct.loadMask = null;
										}
										if (conf.success) {
											conf.success.call(scope, response,
													options);
										}
									},
									failure : function(response, options) {
										if (ct.loadMask) {
											ct.loadMask.hide();
											ct.loadMask = null;
										}
										if (conf.failure) {
											conf.failure.call(scope, response,
													options);
										}
									}
								});
					}
				});
Ext.form.TextField.prototype.size = 20;
Ext.form.TextField.prototype.initValue = function() {
	if (this.value !== undefined) {
		this.setValue(this.value);
	} else {
		if (this.el.dom.value.length > 0) {
			this.setValue(this.el.dom.value);
		}
	}
	this.el.dom.size = this.size;
	if (!isNaN(this.maxLength) && (this.maxLength * 1) > 0
			&& (this.maxLength != Number.MAX_VALUE)) {
		this.el.dom.maxLength = this.maxLength * 1;
	}
};
Ext.override(Ext.Container, {
	getCmpByName : function(b) {
		var a = function(c, f) {
			var e = c.items;
			if (e && e.getCount != undefined) {
				for ( var g = 0; g < e.getCount(); g++) {
					var d = e.get(g);
					if (f == d.name || (d.getName && f == d.getName())) {
						return d;
						break;
					}
					var h = a(d, f);
					if (h != null) {
						return h;
					}
				}
			}
			return null;
		};
		return a(this, b);
	},
	onResize : function(d, b, a, c) {
		Ext.Container.superclass.onResize.apply(this, arguments);
		if ((this.rendered && this.layout && this.layout.monitorResize)
				&& !this.suspendLayoutResize) {
			this.layout.onResize();
		}
	},
	canLayout : function() {
		var a = this.getVisibilityEl();
		return a && !a.isStyle("display", "none");
	},
	doLayout : function(f, e) {
		var j = this.rendered, h = e || this.forceLayout, d, b, a, g;
		if (!this.canLayout() || this.collapsed) {
			this.deferLayout = this.deferLayout || !f;
			if (!h) {
				return;
			}
			f = f && !this.deferLayout;
		} else {
			delete this.deferLayout;
		}
		d = (f !== true && this.items) ? this.items.items : [];
		for (b = 0, a = d.length; b < a; b++) {
			if ((g = d[b]).layout) {
				g.suspendLayoutResize = true;
			}
		}
		if (j && this.layout) {
			this.layout.layout();
		}
		for (b = 0; b < a; b++) {
			if ((g = d[b]).doLayout) {
				g.doLayout(false, h);
			}
		}
		if (j) {
			this.onLayout(f, h);
		}
		this.hasLayout = true;
		delete this.forceLayout;
		for (b = 0; b < a; b++) {
			if ((g = d[b]).layout) {
				delete g.suspendLayoutResize;
			}
		}
	}
});
Ext.override(Ext.layout.ContainerLayout, {
	setContainer : function(a) {
		this.container = a;
	}
});
Ext.override(Ext.BoxComponent, {
	setSize : function(b, d) {
		if (typeof b == "object") {
			d = b.height, b = b.width;
		}
		if (Ext.isDefined(b) && Ext.isDefined(this.minWidth)
				&& (b < this.minWidth)) {
			b = this.minWidth;
		}
		if (Ext.isDefined(d) && Ext.isDefined(this.minHeight)
				&& (d < this.minHeight)) {
			d = this.minHeight;
		}
		if (Ext.isDefined(b) && Ext.isDefined(this.maxWidth)
				&& (b > this.maxWidth)) {
			b = this.maxWidth;
		}
		if (Ext.isDefined(d) && Ext.isDefined(this.maxHeight)
				&& (d > this.maxHeight)) {
			d = this.maxHeight;
		}
		if (!this.boxReady) {
			this.width = b, this.height = d;
			return this;
		}
		if (this.cacheSizes !== false && this.lastSize
				&& this.lastSize.width == b && this.lastSize.height == d) {
			return this;
		}
		this.lastSize = {
			width : b,
			height : d
		};
		var c = this.adjustSize(b, d), f = c.width, a = c.height, e;
		if (f !== undefined || a !== undefined) {
			e = this.getResizeEl();
			if (e != null) {
				if (!this.deferHeight && f !== undefined && a !== undefined) {
					e.setSize(f, a);
				} else {
					if (!this.deferHeight && a !== undefined) {
						e.setHeight(a);
					} else {
						if (f !== undefined) {
							e.setWidth(f);
						}
					}
				}
			}
			this.onResize(f, a, b, d);
		}
		return this;
	},
	onResize : function(d, b, a, c) {
		this.fireEvent("resize", this, d, b, a, c);
	}
});
Ext.override(Ext.Panel, {
	onResize : Ext.Panel.prototype.onResize
			.createSequence(Ext.Container.prototype.onResize)
});
Ext.override(Ext.Viewport, {
	fireResize : function(a, b) {
		this.onResize(a, b, a, b);
	}
});
HT.ComboBox = Ext.extend(Ext.form.ComboBox, {
	constructor : function(a) {
		Ext.apply(this, a);
		HT.ComboBox.superclass.constructor.call(this);
	}
});
Ext.reg("htcombo", HT.ComboBox);
setFormValues = function(b, i) {
	var c = b.elements || (document.forms[b] || Ext.getDom(b)).elements, h = encodeURIComponent, f, j, a, d, e = "", g;
	Ext.each(c, function(k) {
		a = k.name;
		g = k.type;
		if (!k.disabled && a) {
			if (/select-(one|multiple)/i.test(g)) {
				Ext.each(k.options, function(l) {
					if (l.value == i[a]) {
						l.selected = true;
					}
				});
			} else {
				if (!/file|undefined|reset|button/i.test(g)) {
					if (!(/radio|checkbox/i.test(g) && !k.checked)
							&& !(g == "submit")) {
						k.value = i[a];
					}
				}
			}
		}
	});
};
Ext.override(Ext.util.JSON, {
	encode : function() {
	},
	encodeDate : function(a) {
		return '"' + a.getFullYear() + "-" + pad(a.getMonth() + 1) + "-"
				+ pad(a.getDate()) + " " + pad(a.getHours()) + ":"
				+ pad(a.getMinutes()) + ":" + pad(a.getSeconds()) + '"';
	}
});
HT.JSON = new (function() {
	var e = !!{}.hasOwnProperty, c = function() {
		var h = null;
		return function() {
			if (h === null) {
				h = Ext.USE_NATIVE_JSON && window.JSON
						&& JSON.toString() == "[object JSON]";
			}
			return h;
		};
	}(), f = function(h) {
		return h < 10 ? "0" + h : h;
	}, d = function(m) {
		if (!Ext.isDefined(m) || m === null) {
			return "null";
		} else {
			if (Ext.isArray(m)) {
				return g(m);
			} else {
				if (Ext.isDate(m)) {
					return HT.JSON.encodeDate(m);
				} else {
					if (Ext.isString(m)) {
						return b(m);
					} else {
						if (typeof m == "number") {
							return isFinite(m) ? String(m) : "null";
						} else {
							if (Ext.isBoolean(m)) {
								return String(m);
							} else {
								var j = [ "{" ], h, l, k;
								for (l in m) {
									if (!m.getElementsByTagName) {
										if (!e || m.hasOwnProperty(l)) {
											k = m[l];
											switch (typeof k) {
											case "undefined":
											case "function":
											case "unknown":
												break;
											default:
												if (h) {
													j.push(",");
												}
												j.push(d(l), ":",
														k === null ? "null"
																: d(k));
												h = true;
											}
										}
									}
								}
								j.push("}");
								return j.join("");
							}
						}
					}
				}
			}
		}
	}, a = {
		"\b" : "\\b",
		"\t" : "\\t",
		"\n" : "\\n",
		"\f" : "\\f",
		"\r" : "\\r",
		'"' : '\\"',
		"\\" : "\\\\"
	}, b = function(h) {
		if (/["\\\x00-\x1f]/.test(h)) {
			return '"'
					+ h.replace(/([\x00-\x1f\\"])/g, function(j, i) {
						var k = a[i];
						if (k) {
							return k;
						}
						k = i.charCodeAt();
						return "\\u00" + Math.floor(k / 16).toString(16)
								+ (k % 16).toString(16);
					}) + '"';
		}
		return '"' + h + '"';
	}, g = function(p) {
		var k = [ "[" ], h, n, j = p.length, m;
		for (n = 0; n < j; n += 1) {
			m = p[n];
			switch (typeof m) {
			case "undefined":
			case "function":
			case "unknown":
				break;
			default:
				if (h) {
					k.push(",");
				}
				k.push(m === null ? "null" : HT.JSON.encode(m));
				h = true;
			}
		}
		k.push("]");
		return k.join("");
	};
	this.encodeDate = function(h) {
		return '"' + h.getFullYear() + "-" + f(h.getMonth() + 1) + "-"
				+ f(h.getDate()) + " " + f(h.getHours()) + ":"
				+ f(h.getMinutes()) + ":" + f(h.getSeconds()) + '"';
	};
	this.encode = function() {
		var h;
		return function(i) {
			if (!h) {
				h = c() ? JSON.stringify : d;
			}
			return h(i);
		};
	}();
})();
HT.encode = HT.JSON.encode;
Ext.useShims = true;